<?php
defined('IN_CMS') or exit('No permission resources.');

$db = '';
$db = pc_base::load_model('content_model');
$catid = intval($input->get('catid'));
$siteid = intval(dr_cat_value($catid, 'siteid'));
$modelid = intval(dr_cat_value($catid, 'modelid'));
$page = intval($input->get('page')) ? intval($input->get('page')) : 1;
$pagelength = intval($input->get('pagelength')) ? intval($input->get('pagelength')) : 20;
if($catid && $siteid && $modelid) {
	$db->set_model($modelid);
	$where = 'catid='.$catid.' AND status=99';
	$datas = $db->listinfo($where,'id desc',$page,$pagelength);
	$pages = $db->pages;
	foreach ($datas as $r) {
		if($r['islink']) {
			$url='<a href="'.$r['url'].'">';
		} elseif(strpos($r['url'],'http://')!==false || strpos($r['url'],'https://')!==false) {
			$url='<a href="'.$r['url'].'">';
		} else {
			$release_siteurl = substr((string)dr_site_info('domain', $siteid),0,-1);
			$url='<a href="'.$release_siteurl.$r['url'].'">';
		}
		echo('<li>'.$url.'<span class="state tody date">'.mdate($r['updatetime']).'</span><span class="title">'.str_cut($r['title'],100).'</span></a></li>');
	}
}
?>